//
//  ImageAndTitleButton.m
//  EveryDay
//
//  Created by tidoo on 15/12/19.
//  Copyright © 2015年 yuan wei. All rights reserved.
//

#import "ImageAndTitleButton.h"

@implementation ImageAndTitleButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        self.imageView.contentMode=UIViewContentModeScaleAspectFit;
    }
    return self;
}

- (CGRect)contentRectForBounds:(CGRect)bounds
{
    return bounds;
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    return CGRectMake(0, 0, contentRect.size.height, contentRect.size.height);
}
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    return CGRectMake(contentRect.size.height+5, 0, contentRect.size.width-contentRect.size.height-5, contentRect.size.height);
    
}

@end
